package com.shaozi.nc.mq.translation;

import com.shaozi.data.mq.business.base.MqConsts.UserType;
import com.shaozi.data.mq.business.base.SourceTypeConsts.OA.Approve;
import com.shaozi.data.mq.business.bean.MQExchangeData;
import com.shaozi.data.mq.business.bean.MQExchangeRuleBean;
import com.shaozi.data.mq.business.bean.MQPushItem;

public class ApprovePushTranslation extends BaseOaPushTranslation {

	public ApprovePushTranslation() {

	}

	protected int[] onUserType(MQExchangeData data) {
		MQExchangeRuleBean rule = (MQExchangeRuleBean) data.getRule();
		MQPushItem pushItem = rule.getPush();
		switch (pushItem.getSourceType()) {
		case Approve.PassOne:
			return new int[] { UserType.Follow, UserType.Undefine };
		case Approve.Reject:
		case Approve.Complete:
		case Approve.Remove:
			return new int[] { UserType.HandledUserIds, UserType.CC, UserType.Undefine };
		case Approve.CC:
		case Approve.Approver_Invalid:
			return new int[] { UserType.CC, UserType.Undefine };
		default:
			break;
		}
		return super.onUserType(data);
	}
}
